<!DOCTYPE html>

<html>
<head>

		
		
		
		 <link rel="stylesheet" type="text/css" href="http://sandbox.runjs.cn/uploads/rs/408/gjeegkdb/ace.min.css">
<meta charset="UTF-8"><#include "/base/head.html">
<script type="text/javascript" src="http://www.francescomalagrino.com/BootstrapPageGenerator/3/js/jquery-2.0.0.min.js"></script>
<script type="text/javascript" src="http://www.francescomalagrino.com/BootstrapPageGenerator/3/js/jquery-ui"></script>
<link href="http://www.francescomalagrino.com/BootstrapPageGenerator/3/css/bootstrap-combined.min.css" rel="stylesheet" media="screen">
<script type="text/javascript" src="http://www.francescomalagrino.com/BootstrapPageGenerator/3/js/bootstrap.min.js"></script>

		<script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/408/gjeegkdb/ace-extra.min.js">
		</script>
		<script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/408/gjeegkdb/ace.min.js">
		</script>
	
		
</head>
<script type="text/javascript">
	var userDogs = new Object();

	var step = 1;

	console.log(BaseJs.getCookie("diseaseCf"));
	BaseJs.clearCookie();
	console.log(document.cookie);
	$(function() {
		/*
		$("#userDogs input[type='radio']").click(function() {
			//var dogId = $(this).val();
			BaseJs.ajax("${contextPath}/expert/dog/getUserDogDetail", null, function(data) {
				console.log(data);

			});
		});*/
		function arrayContain(key, array) {
			for ( var i in array) {
				if (array[i] == key)
					return true;
			}
			return false;
		}

		function formToJson(form, isUnchecked) {
			var data = $(form).serializeArray();
			var params = new Array();

			for ( var i in data) {
				if (data[i].name == 'ssym')
					params.push(data[i].value);
			}

			data = new Object();

			var jsonRows = JSON.stringify(params);
			var ret = new Object();
			ret.symptomsId = params;

			var uncheckArray = new Array();
			if (isUnchecked) {
				$("input[name='ssym']").not("input:checked").each(function() {
					var key = $(this).val().toString();
					uncheckArray.push(key);

				});
			}
			var uncheckJson = JSON.stringify(uncheckArray);
			ret.uncheckList = uncheckArray;
			return ret;
		}

		function nextClick() {

			var data = formToJson("#symptomForm",true);

			BaseJs.ajax("${contextPath}/expert/getNextCheckRet", data, function(r) {

				$("#resultContent").html("");
			console.log(r.data);
				for ( var i in r.data) {
					$("#resultContent").append('&nbsp;&nbsp;你有' + (r.data[i].sumCf  ) + '%的可能性是' + ' <a  target="_blank" href="${contextPath}/expert/disease_show?id=' + r.data[i].id + '">' + r.data[i].name + '</a>')
				}
				$("#choicesContext").html("");
				var choseAgain = $("<input type='button' clsaa='btn-success' value='继续选择症状确定疾病'>");

				choseAgain.click(function() {
					BaseJs.ajax("${contextPath}/expert/choseAgain", null, function(r) {
						$("#choicesContext").html("");
						var table = $("<table>");
						var data = r.data;
						for ( var i in data) {
							table.append("<tr><td><input type='checkbox' name='ssym' value='"+data[i].id+"'></td><td>" + data[i].name + "</td></tr>");
						}
						$("#choicesContext").append(table);
						var sub = $('<input type="button" id="ssubmit" value="确定"></input>');
						$("#choicesContext").append(sub);
						sub.click(function() {
							nextClick();
						})
					});
				});
				$("#choicesContext").append(choseAgain);
			});
		}

		$("#fsubmit").click(function() {

			var data = formToJson("#symptomForm",false);

			BaseJs.ajax("${contextPath}/expert/getFirstCheckRet", data, function(r) {
				var data = r.data;
				step = 2;

				$("#choicesContext").html("");
				var table = $("<table>");
				for ( var i in data) {
					table.append("<tr><td><input type='checkbox' name='ssym' value='"+data[i].id+"'></td><td>" + data[i].name + "</td></tr>");
				}

				$("#choicesContext").append(table);
				$("#choicesContext").append('<input type="button" class="btn-success" id="ssubmit" value="请继续选择您狗狗的病症(下一步)"></input>');

				$("#ssubmit").click(function() {
					nextClick();
				});

			});
		});

	});
	
	$(function() {
		$(document).on("click", ".firstSymptom", function() {
			var t = this;
			$(".firstSymptom").each(function() {

				var cSymptom = $(this).parents("tr").next().find(".secondSymptom");
				if (!$(this).is(t))
					cSymptom.parent().slideUp("slow");
			});

			var secondSymptom = $(this).parents("tr").next().find(".secondSymptom");
			console.log(secondSymptom);
			secondSymptom.parent().slideDown("slow");
		});
	});
</script>

<body >
<div class="container-fluid" >
	<div class="row-fluid">
		<div class="span12">
			<div class="navbar">
				<div class="navbar-inner">
					<div class="container-fluid">
						<a class="btn btn-navbar" data-target=".navbar-responsive-collapse" data-toggle="collapse"></a> <a class="brand" href="#">宠物诊断</a>
						<ul class="nav pull-right">
							<li>
								<a>${user.nickname} 你好 </a>
							</li>
							<li class="divider-vertical">
							</li>
							<li>
								<a href="${contextPath}/login/ss">退出登录</a>
							</li>
						</ul>
					</div>
				</div>
			</div>
			<div class="row-fluid">
				<div class="span2">
					<div class="sidebar" id="sidebar">
			
			<!-- #sidebar-shortcuts -->
			
			<ul class="nav nav-list">
				<li class="active">
					<a href="/petdogexpert/web-cilent/containhtml.html">
						<i class="icon-dashboard">
						</i>
						<span class="menu-text">
							主菜单 
						</span>
					</a>
				</li>
				
				
				
				<li>
					<a href="#" class="dropdown-toggle">
						<i class="icon-desktop">
						</i>
						<span class="menu-text">
							用户管理 
						</span>
						
						<b class="arrow icon-angle-down">
						</b>
					</a>
					
					<ul class="submenu">
						<li>
							<a href="/petdogexpert/web-cilent/management.html">
								<i class="icon-double-angle-right">
								</i>
								用户信息
							</a>
						</li>
						
						<li>
							<a href="/petdogexpert/web-cilent/NewFile.html>
								<i class="icon-double-angle-right">
								</i>
								宠物犬信息
							</a>
						</li>
						
						
						

						
					</ul>
				</li>
				
				<li>
					<a href="#" class="dropdown-toggle">
						<i class="icon-list">
						</i>
						
							诊断模块 
						
						
						<b class="arrow icon-angle-down">
						</b>
					</a>
					
					<ul class="submenu">
						<li>
							<a href="/petdogexpert/web-cilent/diagnosis.html">
								<i class="icon-double-angle-right">
								</i>
								疾病诊断
							</a>
						</li>
						
						<li>
							<a href="/petdogexpert/web-cilent/NewFile1.html">
								<i class="icon-double-angle-right">
								</i>
								疾病信息查询
							</a>
						</li>
					</ul>
				</li>
				
				
				
				
				
				
				<li>
					<a href="gallery.html">
						<i class="icon-picture">
						</i>
						
							问题反馈
						
					</a>
				</li>
				<li>
					<a href="gallery.html">
						<i class="icon-picture">
						</i>
						
							帮助
						
					</a>
				</li>
				
			
				
				
			</ul>
			<!-- /.nav-list -->
			
			<div class="sidebar-collapse" id="sidebar-collapse">
				<i class="icon-double-angle-left" data-icon1="icon-double-angle-left" data-icon2="icon-double-angle-right">
				</i>
			</div>
			
		</div>
				</div>
				
				<div class="span6" >
				<div class="header">

			<h1 class="page-title">疾病诊断</h1>
			
				<ul class="breadcrumb" contenteditable="true" style="background-color:#FFFFFF;">
<a href="/petdogexpert/web-cilent/containhtml.html">主菜单</a> /</li>

					
							<a href="#">诊断模块</a> /
						
						<class="active">
							疾病诊断
						
</ul>

			

		</div>
				诊断结果显示：
			<div id="resultContent"></div>
				<form id="symptomForm">
				<div id="choicesContext">
				
				<div class="botton group row">
					 <a id="modal-564057" href="#modal-container-564057" role="button" class="btn col-md-3" data-toggle="modal" sid="1">排粪异常</a>
					<div id="modal-container-564057" class="modal hide fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
						<div class="modal-header">
							 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
							<h3 id="myModalLabel">
								排泄异常症状选择
							</h3>
						</div>
						<div class="modal-body">
									<p>
								<div class="checkbox">
   <label><input type="checkbox" sid="12" value="12" name="ssym">粪便有粘液、血液和泡沫</label>
</div>
<div class="checkbox">
   <label><input type="checkbox" sid="14" value="14" name="ssym">腹泻</label>
</div>

							</p>
						</div>
						<div class="modal-footer">
							 <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button> 
						</div>
					</div> <a id="modal-802519" href="#modal-container-802519" role="button" class="btn col-md-3" data-toggle="modal" sid="2" style="color:#FFFFFF;">体温异常</a>
					<div id="modal-container-802519" class="modal hide fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
						<div class="modal-header">
							 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
							<h3 id="myModalLabel">
								体温异常症状选择
							</h3>
						</div>
						<div class="modal-body">
							<p>
							<div class="checkbox">
   <label><input type="checkbox" sid="11" value="11" name="ssym">中等发热</label>
</div>
<div class="checkbox">
   <label><input type="checkbox" sid="18" value="18" name="ssym">高度发热</label>
</div>
							</p>
						</div>
						<div class="modal-footer">
							 <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
						</div>
				
					</div> 
				
					<a id="modal-644245" href="#modal-container-644245" role="button" class="btn col-md-3" data-toggle="modal" sid="3"color:#FFFFFF;">运动异常</a>
					<div id="modal-container-644245" class="modal hide fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
						<div class="modal-header">
							 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
							<h3 id="myModalLabel">
								运动异常症状选择
							</h3>
						</div>
						<div class="modal-body">
							<p>
								<div class="checkbox">
   <label><input type="checkbox" sid="22" value="22" name="ssym">抽搐</label>
</div>
<div class="checkbox">
   <label><input type="checkbox" sid="25" value="25" name="ssym">心悸</label>
</div>
<div class="checkbox">
   <label><input type="checkbox" sid="35" value="35" name="ssym">行动不灵活</label>
</div>
							</p>
						</div>
						<div class="modal-footer">
							 <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button> 
						</div>
						</div>
					</div>
						<div class="botton group row">
					 <a id="modal-616489" href="#modal-container-616489" role="button" class="btn col-md-3" data-toggle="modal" sid="4"color:#FFFFFF;">皮被异常</a>
					<div id="modal-container-616489" class="modal hide fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
						<div class="modal-header">
							 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
							<h3 id="myModalLabel">
								皮被异常症状选择
							</h3>
						</div>
						<div class="modal-body">
							<p>
								<div class="checkbox">
   <label><input type="checkbox" sid="26" value="26" name="ssym">红肿变硬</label>
</div>
<div class="checkbox">
   <label><input type="checkbox" sid="27" value="27" name="ssym">皮肤表层发炎</label>
</div>
							</p>
						</div>
						<div class="modal-footer">
							 <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
						</div>
					</div> <a id="modal-879564" href="#modal-container-879564" role="button" class="btn col-md-3" data-toggle="modal" sid="5"color:#FFFFFF;">排尿异常</a>
					<div id="modal-container-879564" class="modal hide fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
						<div class="modal-header">
							 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
							<h3 id="myModalLabel">
								排尿异常症状选择
							</h3>
						</div>
						<div class="modal-body">
							<p>
								<div class="checkbox">
   <label><input type="checkbox" sid="16" value="16" name="ssym">尿量减少</label>
</div>
</p>
						</div>
						<div class="modal-footer">
							 <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button> 
						</div>
					</div>
					
					<a id="modal-374785" href="#modal-container-374785" role="button" class="btn col-md-3" data-toggle="modal" sid="6"color:#FFFFFF;">食欲异常</a>
					<div id="modal-container-374785" class="modal hide fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
						<div class="modal-header">
							 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
							<h3 id="myModalLabel">
								食欲异常症状选择
							</h3>
						</div>
						<div class="modal-body">
							<p>
								<div class="checkbox">
   <label><input type="checkbox" sid="13" value="13" name="ssym">呕吐</label>
</div>
<div class="checkbox">
   <label><input type="checkbox" sid="19" value="19" name="ssym">厌食</label>
</div>

							</p>
						</div>
						<div class="modal-footer">
							 <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button> 
						</div>
					</div>
					</div>
					<div class="botton group row">
					 <a id="modal-947780" href="#modal-container-947780" role="button" class="btn col-md-3" data-toggle="modal" sid="7"color:#FFFFFF;">呼吸异常</a>
					<div id="modal-container-947780" class="modal hide fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
						<div class="modal-header">
							 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
							<h3 id="myModalLabel">
								呼吸异常症状选择
							</h3>
						</div>
						<div class="modal-body">
							<p>
								<div class="checkbox">
   <label><input type="checkbox" sid="12" value="12" name="ssym">咳嗽</label>
</div>
<div class="checkbox">
   <label><input type="checkbox" sid="14" value="14" name="ssym">呼吸困难</label>
</div>
							</p>
						</div>
						<div class="modal-footer">
							 <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button> 
						</div>
					</div> <a id="modal-871975" href="#modal-container-871975" role="button" class="btn col-md-3" data-toggle="modal" sid="8"color:#FFFFFF;">精神异常</a>
					<div id="modal-container-871975" class="modal hide fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
						<div class="modal-header">
							 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
							<h3 id="myModalLabel">
								精神异常症状选择
							</h3>
						</div>
						<div class="modal-body">
							<p>
								<div class="checkbox">
   <label><input type="checkbox" sid="20" value="20" name="ssym">精神沉郁、嗜睡</label>
</div>
<div class="checkbox">
   <label><input type="checkbox" sid="21" value="21" name="ssym">严重的惊厥</label>
</div>
							</p>
						</div>
						<div class="modal-footer">
							 <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
						</div>
					</div> <a id="modal-371489" href="#modal-container-371489" role="button" class="btn col-md-3" data-toggle="modal" sid="9"color:#FFFFFF;">骨骼异常</a>
					<div id="modal-container-371489" class="modal hide fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
						<div class="modal-header">
							 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
							<h3 id="myModalLabel">
								症状选择
							</h3>
						</div>
						<div class="modal-body">
							<p>
								<div class="checkbox">
   <label><input type="checkbox" sid="36" value="36" name="ssym">关节肿大</label>
</div>

							</p>
						</div>
						<div class="modal-footer">
							 <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button> 
					</div> 
				</div>
				
								 <button type="button" class="btn btn-success col-md-3 col-md-offset-3" style="margin-right:100px;" id="fsubmit">症状选择完毕(下一步)</button>
							</div>
							
				</div>
				</form>
				<div class="span4">
				
				</div>
				
			</div>
			
		</div>
		</div>
	</div>
	
</div>

</body>
</html>